Experiment to rebuild Diffuse using web applets.
at broadcast 528 B view raw
1import type { APIRoute } from "astro"; 2import { getCollection } from "astro:content"; 3 4// API Route 5export const GET: APIRoute = ({ params, props, request }) => { 6 return new Response(JSON.stringify(props.manifest)); 7}; 8 9// Generate static paths 10export async function getStaticPaths() { 11 const manifests = await getCollection("manifests"); 12 13 return manifests.map((manifest) => { 14 return { 15 params: { manifest: manifest.id.replace("/_manifest", "/manifest") }, 16 props: { manifest: manifest.data }, 17 }; 18 }); 19}